<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
	<model>
		<instance>
			<tblContent>
				<nContentKey/>
				<nContentPrimaryId/>
				<nVersion/>
				<cContentForiegnRef/>
				<cContentName/>
				<cContentSchemaName>LibraryImageWithLink</cContentSchemaName>
				<cContentXmlBrief>
          <Content internalLink="" externalLink="" linkType="internal">
						<Title/>
						<Author/>
						<Copyright/>
            <Url type="external"/>
						<Images>
							<img class="thumbnail"/>
							<img class="display"/>
							<img class="detail"/>
						</Images>
						<FileSize/>
						<Body/>
					</Content>
				</cContentXmlBrief>
				<cContentXmlDetail>
          <Content internalLink="" externalLink="" linkType="internal">
						<Title/>
						<Author/>
						<Copyright/>
            <Url type="external"/>
						<Images>
							<img class="thumbnail"/>
							<img class="display"/>
							<img class="detail"/>
						</Images>
						<FileSize/>
						<Body/>
					</Content>
				</cContentXmlDetail>
				<nAuditId/>
				<nAuditKey/>
				<dPublishDate/>
				<dExpireDate/>
				<dInsertDate/>
				<nInsertDirId/>
				<dUpdateDate/>
				<nUpdateDirId/>
				<nStatus>1</nStatus>
				<cDescription/>
			</tblContent>
		</instance>
		<submission id="EditContent" action="" method="post" event="return form_check(this)"/>
		<bind nodeset="tblContent">
			<bind id="cContentImageTitle" nodeset="cContentName" required="false()" type="string"/>
			<bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
			<bind id="dExpireDate" nodeset="dExpireDate" required="false()" type="string"/>
			<bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
			<bind id="cDescription" nodeset="cDescription" required="false()" type="string"/>
			<bind nodeset="cContentXmlBrief/Content">
				<bind id="cContentImageTitle" nodeset="Title" required="false()" type="string"/>
				<bind id="cContentImageAuthor" nodeset="Author" required="false()" type="string"/>
				<bind id="cContentImageCopyright" nodeset="Copyright" required="false()" type="string"/>
				<bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
				<bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
				<bind id="cContentDetail" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
				<bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
        <bind id="cModuleLink" nodeset="@link" required="false()" type="string"/>
        <bind id="cLinkType" nodeset="@linkType" required="false()" type="string"/>
			</bind>
			<bind nodeset="cContentXmlDetail/Content">
				<bind id="cContentImageTitle" nodeset="Title" required="false()" type="string"/>
				<bind id="cContentImageAuthor" nodeset="Author" required="false()" type="string"/>
				<bind id="cContentImageCopyright" nodeset="Copyright" required="false()" type="string"/>
				<bind id="cContentThumbnail" nodeset="Images/img[@class='thumbnail']" required="false()" type="xml-replace"/>
				<bind id="cContentPicture" nodeset="Images/img[@class='display']" required="false()" type="xml-replace"/>
				<bind id="cContentDetail" nodeset="Images/img[@class='detail']" required="false()" type="xml-replace"/>
				<bind id="cContentBody" nodeset="Body" required="false()" type="string"/>
        <bind id="cContentLink" nodeset="@externalLink" required="false()" type="string"/>
        <bind id="cContentPage" nodeset="@internalLink" required="false()" type="string"/>
        <bind id="cLinkType" nodeset="@linkType" required="false()" type="string"/>
			</bind>
		</bind>
	</model>
	<group ref="EditContent" class="2col">
		<label>Edit Library Image (with link)</label>
		<group>
			<group>
				<input bind="nContentKey" class="hidden">
					<label>ContentId</label>
				</input>
				<label>Settings</label>
				<input bind="dPublishDate" class="calendar short">
					<label>Publish Date</label>
				</input>
				<input bind="dExpireDate" class="calendar short">
					<label>Expire Date</label>
				</input>
				<select1 bind="nStatus" appearance="full" class="required vshort">
					<label>Status</label>
					<item>
						<label>Live</label>
						<value>1</value>
					</item>
					<item>
						<label>Hidden</label>
						<value>0</value>
					</item>
				</select1>
				<input bind="cDescription" class="short">
					<label>Change Notes</label>
				</input>
			</group>
			<group class="Content">
				<label>Image files</label>
        <input bind="cContentDetail" class="short pickImage">
          <label>Main image</label>
        </input>
        <help class="inline">
          <p>
            This image should generally be no larger than <b>800x600 pixels, at 72dpi.</b>
          </p>
          <p>The main image is automatically resized for other smaller images such as thumbnails.</p>
          <p>However if you would like a different image for the thumbnail or main product page, they can be specified below.</p>
        </help>
        
				<input bind="cContentThumbnail" class="short pickImage">
					<label>Alternative thumbnail</label>
				</input>
				<!--<input bind="cContentPicture" class="short pickImage">
					<label>Picture</label>
				</input>-->
				
			</group>
		</group>
		<group>
			<group>
				<label>Image Details</label>
				<input bind="cContentImageTitle" class="long">
					<label>Image Title</label>
				</input>
				<input bind="cContentImageAuthor" class="short">
					<label>Image Author</label>
				</input>
				<input bind="cContentImageCopyright" class="short">
					<label>Image Copyright</label>
				</input>
			</group>
			<group ref="mainContent" class="mainContent">
				<label>Image Description</label>
				<textarea bind="cContentBody" class="TextArea xhtml" rows="20" cols="70"/>
			</group>

      <group class="Content">
        <label>Link</label>


        <select1 bind="cLinkType" appearance="full">
          <label>Type of link</label>
          <item>
            <label>Internal (Going to a page on this site)</label>
            <value>internal</value>
            <toggle case="cLinkType_1" event="DOMActivate"/>
          </item>
          <item>
            <label>External (Going to another site)</label>
            <value>external</value>
            <toggle case="cLinkType_2" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cLinkType_1">
            <select1 bind="cModuleLink" class="siteTree">
              <label>Link to page</label>
            </select1>
          </case>
          <case id="cLinkType_2">
            <input bind="cModuleLink" class="short">
              <label>Link to URL</label>
            </input>
          </case>
        </switch>

      </group>
    </group>
	</group>
	<group ref="submit" class="contentSubmit">
		<submit submission="" ref="ewSubmit" class="principle">
			<label>Save Library Image</label>
		</submit>
	</group>
</Content>
